package com.tian.convert;

import com.tian.dto.ChargeRecordInfoRespDto;
import com.tian.entity.ChargeRecord;

import java.util.ArrayList;
import java.util.List;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年05月12日 15:19
 * 博客地址：<a href="http://woaijava.cc/">博客地址</a>
 */
public class ChargeRecordConvertUtil {

    public static List<ChargeRecordInfoRespDto> convert(List<ChargeRecord> chargeRecordList) {
        List<ChargeRecordInfoRespDto> chargeRecordInfoRespDtoList = new ArrayList<>();
        for (ChargeRecord chargeRecord : chargeRecordList) {
            ChargeRecordInfoRespDto chargeRecordInfoRespDto = new ChargeRecordInfoRespDto();
            chargeRecordInfoRespDto.setUserId(chargeRecord.getUserId());
            chargeRecordInfoRespDto.setAddress(chargeRecord.getAddress());
            // TODO: 2023/5/12 待转换
            chargeRecordInfoRespDtoList.add(chargeRecordInfoRespDto);
        }
        return chargeRecordInfoRespDtoList;
    }
}
